/**
 **************************************************************************************************************************
 * 
 **************************************************************************************************************************
 * @file RelaxUVs.h
 **************************************************************************************************************************/

#pragma once

#ifdef  HEADER_MSG
#pragma HEADER_MSG(RelaxUVs.h)
#endif


/**************************************************************************************************************************
 * Includes
 **************************************************************************************************************************/
#include "RBMain/RBVector.h"

/**************************************************************************************************************************
 * Forward declarations
 **************************************************************************************************************************/
static const float g_uvMultiplier = 1.8f;
static bool g_useChordal = false;

/**************************************************************************************************************************
 * Classes
 **************************************************************************************************************************/
struct VertexTerrain
{
	float3 Pos;
	float2 UVs;
};

static const uint32 g_uiNeighborCount = 8;

struct VertexTerrainNeighbor
{
	uint16  NeighborCount;
	uint16  Neighbors[g_uiNeighborCount];
	uint16  TriangleNeighbor1[g_uiNeighborCount];
	uint16  TriangleNeighbor2[g_uiNeighborCount];
	float32 Weights[g_uiNeighborCount];
};

namespace UVRelaxer
{
	void RelaxUVs(const VertexTerrain* input, VertexTerrain* output, uint16 vertexCount, VertexTerrainNeighbor* neighborData);

}